<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <a href="#/">首页</a>
  <a href="#/user">用户</a>
  <a href="#/pro">产品</a>
  <div id="content">
    首页
  </div>
</body>
<script>
  var content = document.getElementById("content");
  window.onhashchange = function (params) {
    var hash = window.location.hash.replace("#", "")
    switch (hash) {
      case '/':
        content.innerHTML = '首页';
        break;
      case '/user':
        content.innerHTML = '用户';
        break;
      case '/pro':
        content.innerHTML = '产品';
        break;
    }
  }
</script>

</html>